package com.zen.demo.sys.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zen.demo.common.enums.EnableEnum;
import com.zen.demo.sys.type.DelimiterStringTypeHandler;
import com.zen.demo.sys.type.UserTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.context.annotation.Primary;

/**
 * <p>
 *
 * </p>
 *
 * @author ZhengDing
 * @since 2022-01-27 22:39:30
 */
@Data
@Getter
@Setter
@Accessors(chain = true)
@TableName(value = "xf_article", autoResultMap = true)
@ApiModel(value = "Article对象", description = "")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("title")
    private String title;

    @TableField(value = "content", condition = SqlCondition.LIKE)
    private String content;

    // @TableField(value = "create_by", insertStrategy = FieldStrategy.IGNORED)
    // private Integer createById;

    @TableField(value = "create_by", typeHandler = UserTypeHandler.class)
    private User createBy;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField("deleted")
    // @TableLogic
    @JsonIgnore
    private String deleted;

    @TableField("version")
    // @Version
    @JsonIgnore
    private String version;

    @TableField("enable")
    private EnableEnum enable;

    @TableField(value = "langs", typeHandler = DelimiterStringTypeHandler.class)
    private List<String> languages;
}
